/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.edu.itschapala.sistemas.septimo.vista;

import javax.swing.UIManager;
import mx.edu.itschapala.sistemas.septimo.control.ClienteLnLocal;
import mx.edu.itschapala.sistemas.septimo.control.ProductoLnLista;
import mx.edu.itschapala.sistemas.septimo.control.ProductoLnLocal;
import mx.edu.itschapala.sistemas.septimo.modelo.Cliente;
import mx.edu.itschapala.sistemas.septimo.modelo.Producto;
import mx.edu.itschapala.sistemas.septimo.vista.enumeracion.TipoVentana;

/**
 *
 * @author alex
 */
public class Dialogo extends javax.swing.JFrame {
    
    private Producto producto;
    private ProductoLnLocal productoControl;
 
    

    /**
     * Creates new form Dialogo
     */
    public Dialogo(Producto producto, ProductoLnLocal productoControl) {
        this.producto=producto;
        this.productoControl=productoControl;
        
         try{
            UIManager.setLookAndFeel("com.jtattoo.plaf.mint.MintLookAndFeel");
            
        }catch (Exception e){
            e.printStackTrace();
        }
       
        initComponents();
    }

    Dialogo() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Editar = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        Cancelar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        Editar.setText("Editar");
        Editar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditarActionPerformed(evt);
            }
        });

        jButton2.setText("Eliminar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        Cancelar.setText("Cancelar");
        Cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(69, 69, 69)
                .addComponent(Editar)
                .addGap(18, 18, 18)
                .addComponent(jButton2)
                .addGap(18, 18, 18)
                .addComponent(Cancelar)
                .addContainerGap(90, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Cancelar)
                    .addComponent(jButton2)
                    .addComponent(Editar))
                .addContainerGap(43, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void CancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelarActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_CancelarActionPerformed

    private void EditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditarActionPerformed
        // TODO add your handling code here:
        ProductoCrearEditar vpce= new ProductoCrearEditar(producto, productoControl, TipoVentana.VENTANA_MODIFICAR);
        vpce.setVisible(true);
    }//GEN-LAST:event_EditarActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        ProductoCrearEditar vcpe2 = new ProductoCrearEditar(producto, productoControl, TipoVentana.VENTANA_ELIMINAR);
        vcpe2.setVisible(true);
    }//GEN-LAST:event_jButton2ActionPerformed

    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Cancelar;
    private javax.swing.JButton Editar;
    private javax.swing.JButton jButton2;
    // End of variables declaration//GEN-END:variables
}
